function addMenu4DistanceMeasure(imgFilePath)
%ADDMENU4DISTANCEMEASURE Adds a MEASUREMENT menu with various options for
%measuring distances on images (mainly for soma, pia, wm, layer borders)
% 
% Select 'Measure' to activate.
%
% Left-click to select points repeatedly, then
% right-click on the final point to exit. 
%
% Distance data are displayed in the Command Window.
%
% Tip: maximize the figure window to select points more precisely.
%
% Special case for "yfrac" measurement: if you click on 4 points total --
% e.g., #1 on the pia, #2 on the L1/2 border, #3 on the soma, and #4 on 
% the L6/WM border -- then the fractional distance of the 3rd point 
% (relative to the 1st and 4th points) will also be calculated. 
%
% gs 2008 03 08
% 2009-11-18 Ben Suter -- modified to pass take image file path as argument
% and pass this to the ben_measureDistances menu command (it is only used
% for record-keeping)
% ------------------------------------

hmenu = uimenu('Label', 'MEASUREMENT');
uimenu(hmenu, 'Label', 'Help', 'Callback', 'help addMenu4DistanceMeasure');
uimenu(hmenu, 'Label', 'Measure', 'Callback', 'measureDistances');
uimenu(hmenu, 'Label', 'Measure (Ben''s version)', 'Callback', ['ben_measureDistances(''' imgFilePath ''')']);
uimenu(hmenu, 'Label', 'Measure (Ben''s version with legacy support)', 'Callback', ['ben_measureDistances(''' imgFilePath ''', ''legacy'')']);

    